<?php
use Entities\Estoque;


$xml = "";

$id = (isset($_REQUEST["id_material"]))? get_request("id_material") :"" ;
$qtd = (isset($_REQUEST["qtd"]))? get_request("qtd") :"" ;

$e = $em->find("Entities\Estoque", $id);
if(empty($e)){
	$e = new Estoque();
}

$e->setQuantidade($qtd);
$em->persist($e);
try {
	$em->flush();
	$erro = 0;
} catch (Exception $e) {
	
	$erro = 1;
}

$xml .= "<erro>$erro</erro>";
echo $xml;